package com.xyrl.project.common.system.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xyrl.common.util.domain.QueryRequest;
import com.xyrl.project.common.system.entity.Role;

import java.util.List;

public interface RoleService extends IService<Role> {

    IPage<Role> findRoles(Role role, QueryRequest request);

    List<Role> findUserRole(String userName);
    /**
     * 取得用户角色并缓存
     * @author zhongp
     * @date 2020-01-02 10:11:53
     * @param userName
    */
    List<Role> findAndCacheUserRole(String userName);

    Role findByName(String roleName);

    void createRole(Role role);

    void deleteRoles(String[] roleIds) throws Exception;

    void updateRole(Role role) throws Exception;
}
